<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>axiethernet: xaxiethernet_example_util.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.gif"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">axiethernet
   </div>
   <div id="projectbrief">Xilinx SDK Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xaxiethernet__example__util_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xaxiethernet_example_util.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This file implements the utility functions for the Axi Ethernet example code. </p>
<pre>
MODIFICATION HISTORY:</pre><pre>Ver   Who  Date     Changes
<hr/>

1.00a asa  6/30/10 First release based on the ll temac driver
3.01a srt  02/03/13 Added support for SGMII mode (CR 676793).
           02/14/13 Added support for Zynq (CR 681136).
3.02a srt  04/24/13 Modified parameter *_SGMII_PHYADDR to *_PHYADDR, the
                    config parameter C_PHYADDR applies to SGMII/1000BaseX
                    modes of operation and added support for 1000BaseX mode
              (CR 704195). Added function *_ConfigureInternalPhy()
              for this purpose.
           04/24/13 Added support for RGMII mode.
3.02a srt  08/06/13 Fixed CR 717949:
                Configures external Marvel 88E1111 PHY based on the
                axi ethernet physical interface type and allows to
                operate in specific interface mode without changing
                jumpers on the Microblaze board.
5.4     adk  07/12/16  Added Support for TI PHY DP83867.</pre><pre></pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a05b61af6fe4608eb0b5fdd7d0ee44a13"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet__example__util_8c.html#a05b61af6fe4608eb0b5fdd7d0ee44a13">PHY_DETECT_REG</a>&#160;&#160;&#160;1</td></tr>
<tr class="memdesc:a05b61af6fe4608eb0b5fdd7d0ee44a13"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function detects the PHY address by looking for successful MII status register contents (PHY register 1).  <a href="#a05b61af6fe4608eb0b5fdd7d0ee44a13">More...</a><br /></td></tr>
<tr class="separator:a05b61af6fe4608eb0b5fdd7d0ee44a13"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a34159f50a227387e3c9d7ea6dd3dfb17"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet__example__util_8c.html#a34159f50a227387e3c9d7ea6dd3dfb17">PHY_R0_CTRL_REG</a>&#160;&#160;&#160;0</td></tr>
<tr class="memdesc:a34159f50a227387e3c9d7ea6dd3dfb17"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set PHY to loopback mode.  <a href="#a34159f50a227387e3c9d7ea6dd3dfb17">More...</a><br /></td></tr>
<tr class="separator:a34159f50a227387e3c9d7ea6dd3dfb17"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a1eb6d3a3d578519d065f1e674d00f144"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet__example__util_8c.html#a1eb6d3a3d578519d065f1e674d00f144">AxiEthernetUtilFrameHdrFormatMAC</a> (EthernetFrame *FramePtr, char *DestAddr)</td></tr>
<tr class="memdesc:a1eb6d3a3d578519d065f1e674d00f144"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the MAC addresses in the frame.  <a href="#a1eb6d3a3d578519d065f1e674d00f144">More...</a><br /></td></tr>
<tr class="separator:a1eb6d3a3d578519d065f1e674d00f144"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa8c4f8ca2870764a5708ae0458d2b96a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet__example__util_8c.html#aa8c4f8ca2870764a5708ae0458d2b96a">AxiEthernetUtilFrameHdrFormatType</a> (EthernetFrame *FramePtr, u16 FrameType)</td></tr>
<tr class="memdesc:aa8c4f8ca2870764a5708ae0458d2b96a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the frame type for the specified frame.  <a href="#aa8c4f8ca2870764a5708ae0458d2b96a">More...</a><br /></td></tr>
<tr class="separator:aa8c4f8ca2870764a5708ae0458d2b96a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5b2b391e4495ed818546c7ec695a724a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet__example__util_8c.html#a5b2b391e4495ed818546c7ec695a724a">AxiEthernetUtilFrameSetPayloadData</a> (EthernetFrame *FramePtr, int PayloadSize)</td></tr>
<tr class="memdesc:a5b2b391e4495ed818546c7ec695a724a"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function places a pattern in the payload section of a frame.  <a href="#a5b2b391e4495ed818546c7ec695a724a">More...</a><br /></td></tr>
<tr class="separator:a5b2b391e4495ed818546c7ec695a724a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a06e72f556318d480d96f454d0b30ced8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet__example__util_8c.html#a06e72f556318d480d96f454d0b30ced8">AxiEthernetUtilFrameHdrVlanFormatVid</a> (EthernetFrame *FramePtr, u32 VlanNumber, u32 Vid)</td></tr>
<tr class="memdesc:a06e72f556318d480d96f454d0b30ced8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the frame VLAN info for the specified frame.  <a href="#a06e72f556318d480d96f454d0b30ced8">More...</a><br /></td></tr>
<tr class="separator:a06e72f556318d480d96f454d0b30ced8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1c4df4db47e1cfcddd9c8c8cbda8a910"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet__example__util_8c.html#a1c4df4db47e1cfcddd9c8c8cbda8a910">AxiEthernetUtilFrameHdrVlanFormatType</a> (EthernetFrame *FramePtr, u16 FrameType, u32 VlanNumber)</td></tr>
<tr class="memdesc:a1c4df4db47e1cfcddd9c8c8cbda8a910"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the frame type for the specified frame.  <a href="#a1c4df4db47e1cfcddd9c8c8cbda8a910">More...</a><br /></td></tr>
<tr class="separator:a1c4df4db47e1cfcddd9c8c8cbda8a910"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9b863f85b5cf0cd2245ee4df20515443"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet__example__util_8c.html#a9b863f85b5cf0cd2245ee4df20515443">AxiEthernetUtilFrameSetVlanPayloadData</a> (EthernetFrame *FramePtr, int PayloadSize, u32 VlanNumber)</td></tr>
<tr class="memdesc:a9b863f85b5cf0cd2245ee4df20515443"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function places a pattern in the payload section of a frame.  <a href="#a9b863f85b5cf0cd2245ee4df20515443">More...</a><br /></td></tr>
<tr class="separator:a9b863f85b5cf0cd2245ee4df20515443"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a561ef796435e1aa0b0eb5013bfb54cea"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet__example__util_8c.html#a561ef796435e1aa0b0eb5013bfb54cea">AxiEthernetUtilFrameVerify</a> (EthernetFrame *CheckFrame, EthernetFrame *ActualFrame)</td></tr>
<tr class="memdesc:a561ef796435e1aa0b0eb5013bfb54cea"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function verifies the frame data against a CheckFrame.  <a href="#a561ef796435e1aa0b0eb5013bfb54cea">More...</a><br /></td></tr>
<tr class="separator:a561ef796435e1aa0b0eb5013bfb54cea"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a69500ccf415291fc54dfc53333f98a07"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet__example__util_8c.html#a69500ccf415291fc54dfc53333f98a07">AxiEthernetUtilFrameMemClear</a> (EthernetFrame *FramePtr)</td></tr>
<tr class="memdesc:a69500ccf415291fc54dfc53333f98a07"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function sets all bytes of a frame to 0.  <a href="#a69500ccf415291fc54dfc53333f98a07">More...</a><br /></td></tr>
<tr class="separator:a69500ccf415291fc54dfc53333f98a07"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac864e2449120d62d81370b033fc89c42"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet__example__util_8c.html#ac864e2449120d62d81370b033fc89c42">AxiEthernetUtilEnterLoopback</a> (<a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *AxiEthernetInstancePtr, int Speed)</td></tr>
<tr class="memdesc:ac864e2449120d62d81370b033fc89c42"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function sets the PHY to loopback mode.  <a href="#ac864e2449120d62d81370b033fc89c42">More...</a><br /></td></tr>
<tr class="separator:ac864e2449120d62d81370b033fc89c42"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad700d3b9e292277d5437ecc4dc304dc3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet__example__util_8c.html#ad700d3b9e292277d5437ecc4dc304dc3">AxiEthernetUtilErrorTrap</a> (char *Message)</td></tr>
<tr class="memdesc:ad700d3b9e292277d5437ecc4dc304dc3"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is called by example code when an error is detected.  <a href="#ad700d3b9e292277d5437ecc4dc304dc3">More...</a><br /></td></tr>
<tr class="separator:ad700d3b9e292277d5437ecc4dc304dc3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0ab0dcd0f95007ddcc441c7cbc5f45dc"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet__example__util_8c.html#a0ab0dcd0f95007ddcc441c7cbc5f45dc">AxiEthernetUtilPhyDelay</a> (unsigned int Seconds)</td></tr>
<tr class="memdesc:a0ab0dcd0f95007ddcc441c7cbc5f45dc"><td class="mdescLeft">&#160;</td><td class="mdescRight">For Microblaze we use an assembly loop that is roughly the same regardless of optimization level, although caches and memory access time can make the delay vary.  <a href="#a0ab0dcd0f95007ddcc441c7cbc5f45dc">More...</a><br /></td></tr>
<tr class="separator:a0ab0dcd0f95007ddcc441c7cbc5f45dc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3fa74e53e08b376fca070fd5613687ae"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet__example__util_8c.html#a3fa74e53e08b376fca070fd5613687ae">AxiEthernetUtilConfigureInternalPhy</a> (<a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *AxiEthernetInstancePtr, int Speed)</td></tr>
<tr class="memdesc:a3fa74e53e08b376fca070fd5613687ae"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function configures the internal phy for SGMII and 1000baseX modes.  <a href="#a3fa74e53e08b376fca070fd5613687ae">More...</a><br /></td></tr>
<tr class="separator:a3fa74e53e08b376fca070fd5613687ae"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a05b61af6fe4608eb0b5fdd7d0ee44a13"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a05b61af6fe4608eb0b5fdd7d0ee44a13">&#9670;&nbsp;</a></span>PHY_DETECT_REG</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PHY_DETECT_REG&#160;&#160;&#160;1</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function detects the PHY address by looking for successful MII status register contents (PHY register 1). </p>
<p>It looks for a PHY that supports auto-negotiation and 10Mbps full-duplex and half-duplex. So, this code won't work for PHYs that don't support those features, but it's a bit more general purpose than matching a specific PHY manufacturer ID.</p>
<p>Note also that on some (older) Xilinx ML4xx boards, PHY address 0 does not properly respond to this query. But, since the default is 0 and asssuming no other address responds, then it seems to work OK.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">The</td><td>Axi Ethernet driver instance</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The address of the PHY (defaults to 0 if none detected)</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a id="a34159f50a227387e3c9d7ea6dd3dfb17"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a34159f50a227387e3c9d7ea6dd3dfb17">&#9670;&nbsp;</a></span>PHY_R0_CTRL_REG</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PHY_R0_CTRL_REG&#160;&#160;&#160;0</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set PHY to loopback mode. </p>
<p>This works with the marvell PHY common on ML40x evaluation boards</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">Speed</td><td>is the loopback speed 10, 100, or 1000 Mbit </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a3fa74e53e08b376fca070fd5613687ae"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3fa74e53e08b376fca070fd5613687ae">&#9670;&nbsp;</a></span>AxiEthernetUtilConfigureInternalPhy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int AxiEthernetUtilConfigureInternalPhy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *&#160;</td>
          <td class="paramname"><em>AxiEthernetInstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>Speed</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function configures the internal phy for SGMII and 1000baseX modes. </p>
<ul>
<li><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">AxiEthernetInstancePtr</td><td>is a pointer to the instance of the AxiEthernet component. </td></tr>
    <tr><td class="paramname">Speed</td><td>is the loopback speed 10, 100, or 1000 Mbit.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>- XST_SUCCESS if successful.<ul>
<li>XST_FAILURE, in case of failure..</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>
</li>
</ul>

</div>
</div>
<a id="ac864e2449120d62d81370b033fc89c42"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac864e2449120d62d81370b033fc89c42">&#9670;&nbsp;</a></span>AxiEthernetUtilEnterLoopback()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int AxiEthernetUtilEnterLoopback </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *&#160;</td>
          <td class="paramname"><em>AxiEthernetInstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>Speed</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function sets the PHY to loopback mode. </p>
<p>This works with the marvell PHY common on ML40x evaluation boards.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">AxiEthernetInstancePtr</td><td>is a pointer to the instance of the AxiEthernet component. </td></tr>
    <tr><td class="paramname">Speed</td><td>is the loopback speed 10, 100, or 1000 Mbit.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>- XST_SUCCESS if successful.<ul>
<li>XST_FAILURE, in case of failure..</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="group__axiethernet__v5__0.html#gadc2cf9ec186f1dffaece1552f96fcdd9">XAxiEthernet_GetPhysicalInterface</a>.</p>

</div>
</div>
<a id="ad700d3b9e292277d5437ecc4dc304dc3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad700d3b9e292277d5437ecc4dc304dc3">&#9670;&nbsp;</a></span>AxiEthernetUtilErrorTrap()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void AxiEthernetUtilErrorTrap </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>Message</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is called by example code when an error is detected. </p>
<p>It can be set as a breakpoint with a debugger or it can be used to print out the given message if there is a UART or STDIO device.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">Message</td><td>is the text explaining the error</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None </dd></dl>

<p class="reference">Referenced by <a class="el" href="xaxiethernet__example__polled_8c.html#a827aa292a20f9a15e68bfe60e82cfc13">AxiEthernetPolledExample()</a>, and <a class="el" href="xaxiethernet__example__extmulticast_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main()</a>.</p>

</div>
</div>
<a id="a1eb6d3a3d578519d065f1e674d00f144"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1eb6d3a3d578519d065f1e674d00f144">&#9670;&nbsp;</a></span>AxiEthernetUtilFrameHdrFormatMAC()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void AxiEthernetUtilFrameHdrFormatMAC </td>
          <td>(</td>
          <td class="paramtype">EthernetFrame *&#160;</td>
          <td class="paramname"><em>FramePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>DestAddr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the MAC addresses in the frame. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">FramePtr</td><td>is the pointer to the frame. </td></tr>
    <tr><td class="paramname">DestAddr</td><td>is the Destination MAC address.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">Referenced by <a class="el" href="xaxiethernet__example__polled_8c.html#afca56032499429904944d2fc83975c9f">AxiEthernetSingleFramePolledExample()</a>.</p>

</div>
</div>
<a id="aa8c4f8ca2870764a5708ae0458d2b96a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa8c4f8ca2870764a5708ae0458d2b96a">&#9670;&nbsp;</a></span>AxiEthernetUtilFrameHdrFormatType()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void AxiEthernetUtilFrameHdrFormatType </td>
          <td>(</td>
          <td class="paramtype">EthernetFrame *&#160;</td>
          <td class="paramname"><em>FramePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>FrameType</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the frame type for the specified frame. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">FramePtr</td><td>is the pointer to the frame. </td></tr>
    <tr><td class="paramname">FrameType</td><td>is the Type to set in frame.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a id="a1c4df4db47e1cfcddd9c8c8cbda8a910"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1c4df4db47e1cfcddd9c8c8cbda8a910">&#9670;&nbsp;</a></span>AxiEthernetUtilFrameHdrVlanFormatType()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void AxiEthernetUtilFrameHdrVlanFormatType </td>
          <td>(</td>
          <td class="paramtype">EthernetFrame *&#160;</td>
          <td class="paramname"><em>FramePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>FrameType</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>VlanNumber</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the frame type for the specified frame. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">FramePtr</td><td>is the pointer to the frame. </td></tr>
    <tr><td class="paramname">FrameType</td><td>is the Type to set in frame. </td></tr>
    <tr><td class="paramname">VlanNumber</td><td>is the VLAN friendly adjusted insertion position to set in frame.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a id="a06e72f556318d480d96f454d0b30ced8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a06e72f556318d480d96f454d0b30ced8">&#9670;&nbsp;</a></span>AxiEthernetUtilFrameHdrVlanFormatVid()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void AxiEthernetUtilFrameHdrVlanFormatVid </td>
          <td>(</td>
          <td class="paramtype">EthernetFrame *&#160;</td>
          <td class="paramname"><em>FramePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>VlanNumber</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>Vid</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the frame VLAN info for the specified frame. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">FramePtr</td><td>is the pointer to the frame. </td></tr>
    <tr><td class="paramname">VlanNumber</td><td>is the VlanValue insertion position to set in frame. </td></tr>
    <tr><td class="paramname">Vid</td><td>is the 4 bytes Vlan value (TPID, Priority, CFI, VID) to be set in frame.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a id="a69500ccf415291fc54dfc53333f98a07"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a69500ccf415291fc54dfc53333f98a07">&#9670;&nbsp;</a></span>AxiEthernetUtilFrameMemClear()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void AxiEthernetUtilFrameMemClear </td>
          <td>(</td>
          <td class="paramtype">EthernetFrame *&#160;</td>
          <td class="paramname"><em>FramePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function sets all bytes of a frame to 0. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">FramePtr</td><td>is a pointer to the frame itself.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a id="a5b2b391e4495ed818546c7ec695a724a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5b2b391e4495ed818546c7ec695a724a">&#9670;&nbsp;</a></span>AxiEthernetUtilFrameSetPayloadData()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void AxiEthernetUtilFrameSetPayloadData </td>
          <td>(</td>
          <td class="paramtype">EthernetFrame *&#160;</td>
          <td class="paramname"><em>FramePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>PayloadSize</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function places a pattern in the payload section of a frame. </p>
<p>The pattern is a 8 bit incrementing series of numbers starting with 0. Once the pattern reaches 256, then the pattern changes to a 16 bit incrementing pattern: </p><pre>
  0, 1, 2, ... 254, 255, 00, 00, 00, 01, 00, 02, ...
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">FramePtr</td><td>is a pointer to the frame to change. </td></tr>
    <tr><td class="paramname">PayloadSize</td><td>is the number of bytes in the payload that will be set.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a id="a9b863f85b5cf0cd2245ee4df20515443"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9b863f85b5cf0cd2245ee4df20515443">&#9670;&nbsp;</a></span>AxiEthernetUtilFrameSetVlanPayloadData()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void AxiEthernetUtilFrameSetVlanPayloadData </td>
          <td>(</td>
          <td class="paramtype">EthernetFrame *&#160;</td>
          <td class="paramname"><em>FramePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>PayloadSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>VlanNumber</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function places a pattern in the payload section of a frame. </p>
<p>The pattern is a 8 bit incrementing series of numbers starting with 0. Once the pattern reaches 256, then the pattern changes to a 16 bit incrementing pattern: </p><pre>
  0, 1, 2, ... 254, 255, 00, 00, 00, 01, 00, 02, ...
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">FramePtr</td><td>is a pointer to the frame to change. </td></tr>
    <tr><td class="paramname">PayloadSize</td><td>is the number of bytes in the payload that will be set. </td></tr>
    <tr><td class="paramname">VlanNumber</td><td>is the VLAN friendly adjusted insertion position to set in frame.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a id="a561ef796435e1aa0b0eb5013bfb54cea"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a561ef796435e1aa0b0eb5013bfb54cea">&#9670;&nbsp;</a></span>AxiEthernetUtilFrameVerify()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int AxiEthernetUtilFrameVerify </td>
          <td>(</td>
          <td class="paramtype">EthernetFrame *&#160;</td>
          <td class="paramname"><em>CheckFrame</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">EthernetFrame *&#160;</td>
          <td class="paramname"><em>ActualFrame</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function verifies the frame data against a CheckFrame. </p>
<p>Validation occurs by comparing the ActualFrame to the header of the CheckFrame. If the headers match, then the payload of ActualFrame is verified for the same pattern Util_FrameSetPayloadData() generates.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">CheckFrame</td><td>is a pointer to a frame containing the 14 byte header that should be present in the ActualFrame parameter. </td></tr>
    <tr><td class="paramname">ActualFrame</td><td>is a pointer to a frame to validate.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>- XST_SUCCESS if successful.<ul>
<li>XST_FAILURE in case of failure.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a id="a0ab0dcd0f95007ddcc441c7cbc5f45dc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0ab0dcd0f95007ddcc441c7cbc5f45dc">&#9670;&nbsp;</a></span>AxiEthernetUtilPhyDelay()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void AxiEthernetUtilPhyDelay </td>
          <td>(</td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>Seconds</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>For Microblaze we use an assembly loop that is roughly the same regardless of optimization level, although caches and memory access time can make the delay vary. </p>
<p>Just keep in mind that after resetting or updating the PHY modes, the PHY typically needs time to recover.</p>
<dl class="section return"><dt>Returns</dt><dd>None</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Copyright &copy; 2015 Xilinx Inc. All rights reserved.</li>
  </ul>
</div>
</body>
</html>
